package com.wdhcr.entity.weixin;

public class AccessToken {


    private String accessToken;
    private long expireTime;

    public AccessToken(String accessToken, String expireIn) {
        this.accessToken = accessToken;
        expireTime = System.currentTimeMillis()+Integer.parseInt(expireIn)*1000;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }

    /**
     * @description: 判断token是否过期
     * @params: []
     * @return: boolean
     * @author: wdhcr
     * @dateTime: 2019/12/30 23:53
     */
    public boolean isExpired(){
        return System.currentTimeMillis()>expireTime;
    }
}
